﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using BLL.Interfaces;
using Microsoft.Practices.ServiceLocation;
using POCOS;

namespace MagazineWebForms.Authors
{
    public  class BasePage:System.Web.UI.Page
    {
        private static IAuteurServices _auteurServices ;
        private static IArticlesServices _articleservices;

        //auteurs Serives
        public static IAuteurServices GetAuteurServices()
        {
           return  _auteurServices = ServiceLocator.Current.GetInstance<IAuteurServices>();
        }

        //articles Services
        public static IArticlesServices GetArticleServices()
        {
            return _articleservices = ServiceLocator.Current.GetInstance<IArticlesServices>();
        }


        //Get USer membership Provider
        public static MembershipUser GetUser()
        {
            MembershipUser user = null;
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                return Membership.GetUser();
            }
            else
            {

                return user;
            }
         }

       
        


    }




}